<template>
	<view>
		<u-grid :col="3" :border="false" @click="toNav">
			<u-grid-item name="1">
				<u-badge :value="messageStats.like_collect_count" max="99" :absolute="true" :offset="[0, 30]"></u-badge>
				<image class="nav-icon" src="/static/images/icon/souc.png"></image>
				<view class="grid-text">赞和收藏</view>
			</u-grid-item>
			<u-grid-item name="2">
				<u-badge :value="messageStats.follow_count" max="99" :absolute="true" :offset="[0, 30]"></u-badge>
				<image class="nav-icon" src="/static/images/icon/gz.png"></image>
				<view class="grid-text">新增关注</view>
			</u-grid-item>
			<u-grid-item name="3">
				<u-badge :value="messageStats.comment_count" max="99" :absolute="true" :offset="[0, 30]"></u-badge>
				<image class="nav-icon" src="/static/images/icon/pl.png"></image>
				<view class="grid-text">评论</view>
			</u-grid-item>
		</u-grid>
		<view class="msg-wrap">
			<view class="title">
				<view class="left">通知</view>
			</view>
			<view class="msg-empty">
				<image class="img" mode="widthFix" src="/static/empty.png"></image>
				<text class="txt">暂无新消息</text>
			</view>
		</view>
		<q-tabbar :selected="3"></q-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showSheet: false,
				showChatSheet: false,
				checkedMsgId: '',
				checkedIndex: '',
				checkedMsgUid: '',
			};
		},
		computed: {
			userInfo() {
				return this.$store.state.user.userInfo;
			},
			messageStats() {
				return this.$store.state.user.messageStats;
			}
		},
		filters: {
			replace(str) {
				return str.replace(/<.*?>/g, "")
			}
		},
		onShow() {
			this.$store.dispatch('getMessage');
		},
		methods: {
			toNav(e) {
				uni.navigateTo({
					url: '/pages/message/list?type=' + e
				});
			}
		}
	};
</script>

<style lang="scss" scoped>
	.nav-icon {
		width: 90rpx;
		height: 90rpx;
		margin-bottom: 10rpx;
	}

	.msg-wrap {
		background-color: #ffffff;
		margin-top: 20rpx;

		.title {
			margin: 20rpx;
		}
	}

	.msg-empty {
		display: flex;
		flex-direction: column;
		align-items: center;
		min-height: 800rpx;

		.img {
			width: 200rpx;
			margin-top: 100rpx;
		}

		.txt {
			color: #999;
			font-size: 20rpx;
			margin-top: 20rpx;
		}
	}
</style>